//文章分类的接口 路由模块
const express = require('express')
const router = express.Router()


// //导入用户路由处理函数对应的模块
const user_handler = require('../router_handler/artcate')
//导入验证数据的中间件
const expressJoi = require('@escook/express-joi')
//导入验证规则
const { add_cate_schema, deleteId_schema, update_schema } = require('../schema/artcate')

router.get('/cates', user_handler.getArtcate)
//新增文章分类的接口
router.post('/addcates', expressJoi(add_cate_schema), user_handler.addArtcleCates)
//删除文章分类的接口
router.get('/deleteCate/:id', expressJoi(deleteId_schema), user_handler.deleteCateById)
//根据id查询文章的接口
router.get('/cateShow/:id', expressJoi(deleteId_schema), user_handler.getArtcateShowId)
//根据id name alias 更新文章的别名
router.post('/updateCate', expressJoi(update_schema), user_handler.updateCateById)
module.exports = router